package com.zbkj.client.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

@Configuration
public class TaskSchedulerConfig {
    @Bean
    public ThreadPoolTaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        scheduler.setPoolSize(4); // 可根据实际并发量调整
        scheduler.setThreadNamePrefix("custom-dp-task-");
        scheduler.setRemoveOnCancelPolicy(true);
        return scheduler;
    }
}
